use ggez::mint::Point2;
use rand::{
    distributions::{Distribution, Standard},
    Rng,
};
pub enum Movements {LEFT, RIGHT, UP, DOWN}

impl Distribution<Movements> for Standard {
    fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> Movements {
        match _rng.gen_range(0..4) {
            0 => Movements::LEFT,
            1 => Movements::RIGHT,
            2 => Movements::UP,
            _ => Movements::DOWN
        }
    }
}
pub struct Walker {
    location: Point2<f32>
}

impl Walker {
    pub fn new(location: Point2<f32>) -> Walker{
        Walker{location : location}
    }
    pub fn get_location(& self) -> Point2<f32> {
        self.location
    }
    pub fn move_to(&mut self, movement: Movements) {
        match movement {
            Movements::LEFT => {self.location.x -=1.0},
            Movements::RIGHT => {self.location.x +=1.0},
            Movements::DOWN => {self.location.y +=1.0},
            Movements::UP => {self.location.y -=1.0}
        }
    }
}
